package com.hqs.listener.utils;

/**
 * Created by apple on 16/9/26.
 */

public class TimeUtil {


    public static String timeOf(int sec) {
        int hour = sec / 3600;
        int min = (sec % 3600) / 60;
        int s = sec % 60;
        String time = "";
        if (hour > 0) {
            time += hour + "时";
        }
        if (min < 10) {
            if (min == 0){
                time += "00分";
            }
            else{
                if (hour > 0) {
                    time += "0" + min + "分";
                }
                else {
                    time += min + "分";
                }
            }
        }
        else {
            time += min + "分";
        }
        if (s > 0) {
            if (s < 10){
                time += "0" + s + "秒";
            }
            else {
                time += s + "秒";
            }
        }
        return time;
    }
}


